from PyQt4 import QtGui
from design.Ui_DirectoryEditWidget import Ui_DirectoryEditWidgetClass
from PyQt4.QtGui import QFileDialog

class DirectoryEditWidget(QtGui.QWidget):
	def __init__(self, parent = None):
		QtGui.QWidget.__init__(self, parent)
		self.ui = Ui_DirectoryEditWidgetClass()
		self.ui.setupUi(self)
		self.ui.ChangeDirPB.clicked.connect(self.onShowFileDialog)
	
	def onShowFileDialog(self):
		dirPath = QFileDialog.getExistingDirectory(self, caption='Choose working directory')
		if dirPath != None and dirPath != '':
			self.ui.DirectoryNameLE.setText(dirPath)
	